package com.sdcx.agrobank.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.blankj.utilcode.util.SPUtils;
import com.sdcx.agrobank.R;

public class ZCFZActivity extends AppCompatActivity {
    private ImageView back;
    private EditText zichan1;
    private EditText huoqi1;
    private EditText weihao1;
    private RelativeLayout rl;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_z_c_f_z);
        String zc = SPUtils.getInstance().getString("zichan1");
        String fz = SPUtils.getInstance().getString("fuzhai1");
        String wh = SPUtils.getInstance().getString("weihao1");

        back = findViewById(R.id.back);
        zichan1 = findViewById(R.id.zichan1);
        huoqi1 = findViewById(R.id.huoqi1);
        weihao1 = findViewById(R.id.weihao1);

        zichan1.setText(zc);
        huoqi1.setText(fz);
        weihao1.setText(wh);
        rl = findViewById(R.id.rl);
        String zichan = SPUtils.getInstance().getString("zichan");
        // String fuzhai = SPUtils.getInstance().getString("fuzhai");
        zichan1.setText(zichan);
        huoqi1.setText(zichan);
        weihao1.setText(zichan);
        rl.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View arg0, MotionEvent arg1) {
                rl.setFocusable(true);
                // 如果xml文件里面没设置，就需要在这里设置
                rl.setFocusableInTouchMode(true);
                rl.requestFocus();
                zichan1.setCursorVisible(false);
                huoqi1.setCursorVisible(false);
                weihao1.setCursorVisible(false);
                SPUtils.getInstance().put("zichan1",zichan1.getText().toString());
                SPUtils.getInstance().put("fuzhai1",huoqi1.getText().toString());
                SPUtils.getInstance().put("weihao1",weihao1.getText().toString());
                return false;
            }
        });
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}